import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';
import { rules } from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [

  {
    title: '设备号',
    align: "center",
    dataIndex: 'desca'
  }, {
    title: '设备名称',
    align: "center",
    dataIndex: 'names'
  },
  {
    title: '本次运行时长',
    align: "center",
    dataIndex: 'runTime'
  }, {
    title: '开始时间',
    align: "center",
    dataIndex: 'startTime',
    customRender: ({ text }) => {
      return !text ? "" : (text.length > 10 ? text.substr(0, 10) : text);
    },
  },
  {
    title: ' 结束时间',
    align: "center",
    dataIndex: 'endTime',
    customRender: ({ text }) => {
      return !text ? "" : (text.length > 10 ? text.substr(0, 10) : text);
    },
  },
  {
    title: '是否删除',
    align: "center",
    dataIndex: 'isDeleted'
  },
];

//查询数据
export const searchFormSchema: FormSchema[] = [
];

//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '开始时间',
    field: 'startTime',
    component: 'DatePicker',
  },
  {
    label: ' 结束时间',
    field: 'endTime',
    component: 'DatePicker',
  },
  {
    label: '描述',
    field: 'desc',
    component: 'Input',
  },
  {
    label: '本次运行时长',
    field: 'runTime',
    component: 'Input',
  },
  // {
  //   label: '是否删除',
  //   field: 'isDeleted',
  //   component: 'Input',
  // },
  // TODO 主键隐藏字段，目前写死为ID
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false,
  },
];
